package com.wangsd.web.report.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wangsd.web.report.entity.TOrder;
import com.wangsd.web.report.mapper.TOrderMapper;
import com.wangsd.web.report.service.TOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author generator
 * @since 2019-09-23
 */
@Service
public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService {
    @Resource
    TOrderMapper tOrderMapper;

    @Override
    public IPage<TOrder> selectList(Integer pageNum, Integer pageSize, TOrder params, String code) {
        Page<TOrder> page = new Page<>(pageNum, pageSize);
        IPage<TOrder> resultIPage = tOrderMapper.selectListXml(page, params, code);
        return resultIPage;
    }


    @Override
    public TOrder selectByOutTradeNo(String outTradeNo) {
        QueryWrapper<TOrder> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("out_trade_no", outTradeNo);
        return tOrderMapper.selectOne(queryWrapper);
    }
}